package com.vastcom.sigma.admin.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;

@Entity
public class Loginlog {
    private String id;
    private String userid;
    private String username;
    private String ip;
    private String os;
    private String browser;
    private Timestamp logintime;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "userid")
    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "ip")
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "os")
    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    @Basic
    @Column(name = "browser")
    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    @Basic
    @Column(name = "logintime")
    public Timestamp getLogintime() {
        return logintime;
    }

    public void setLogintime(Timestamp logintime) {
        this.logintime = logintime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Loginlog loginlog = (Loginlog) o;

        if (id != null ? !id.equals(loginlog.id) : loginlog.id != null) return false;
        if (userid != null ? !userid.equals(loginlog.userid) : loginlog.userid != null) return false;
        if (username != null ? !username.equals(loginlog.username) : loginlog.username != null) return false;
        if (ip != null ? !ip.equals(loginlog.ip) : loginlog.ip != null) return false;
        if (os != null ? !os.equals(loginlog.os) : loginlog.os != null) return false;
        if (browser != null ? !browser.equals(loginlog.browser) : loginlog.browser != null) return false;
        if (logintime != null ? !logintime.equals(loginlog.logintime) : loginlog.logintime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (userid != null ? userid.hashCode() : 0);
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (ip != null ? ip.hashCode() : 0);
        result = 31 * result + (os != null ? os.hashCode() : 0);
        result = 31 * result + (browser != null ? browser.hashCode() : 0);
        result = 31 * result + (logintime != null ? logintime.hashCode() : 0);
        return result;
    }
}
